<template>
  <div class="examine">
    <div class="whole">
      <div class="title">社团整体报名数据</div>
      <div class="data-box">
        <div class="apply data">
          <p>社团总报名人数：</p>
          {{ apply_num }}
        </div>
        <div class="pass data">
          <p>总通过人数：</p>
          {{ adopt_num }}
        </div>
      </div>
    </div>
    <div class="groups">
      <div class="group" v-for="item in list" :key="item.name + item.id">
        <p class="title">{{ item.name }}</p>
        <div class="data-box">
          <div class="data">
            <p class="name">报名人数为:</p>
            <p class="num">{{ item.applyNum }}</p>
          </div>
          <div class="data">
            <p class="name">目前通过人数为:</p>
            <p class="num">{{ item.adoptNum }}</p>
          </div>
        </div>
      </div>
    </div>
    <div class="bottom">
      <Button
        info="返回"
        backColor="#20618C"
        :event="
          () => {
            router.push({ name: 'AQuickManage' });
          }
        "
      ></Button>
    </div>
  </div>
</template>

<script lang="ts" setup>
import { ref } from "vue";
import { useRouter } from "vue-router";
import Button from "../components/Button.vue";
import GetInfo from "../api/GetInfo";
const router = useRouter();
let apply_num = ref(0);
let adopt_num = ref(0);
let list = ref([]);
GetInfo.selectById(~~sessionStorage.getItem("assId")).then((res) => {
  console.log(res);
  apply_num.value = res.applyNum;
  adopt_num.value = res.adoptNum;
  list.value = res.list;
});
</script>

<style lang="scss">
$colors: (
  "t-grey": #8a8888,
  //字体常用颜色--灰
  "t-white": #f5f5f5,
  //字体常用颜色--白
  "border": #707070,
  //边框颜色
  "W_blue": #20618c,
  "L-blue": #3f8989,
  "green": #158f9c,
);
.examine {
  width: 1300px;
  margin: 0 auto;
  .whole {
    height: 150px;
    background: white;
    box-shadow: 3px 3px 10px map-get($map: $colors, $key: t-grey);
    .title {
      height: 50px;
      text-align: center;
      font-size: 30px;
      font-weight: bold;
      color: map-get($map: $colors, $key: W_blue);
    }
    .data-box {
      width: 100%;
      height: 100px;
      display: flex;
      justify-content: space-between;
      .data {
        width: 50%;
        text-align: center;
        font-size: 50px;
        font-weight: bold;
        color: map-get($map: $colors, $key: W_blue);
        p {
          text-align: center;
          font-size: 25px;
          color: map-get($map: $colors, $key: t-grey);
        }
      }
    }
  }
  .groups {
    margin-top: 60px;
    display: flex;
    justify-content: space-around;
    .group {
      background-color: white;
      width: 200px;
      height: 400px;
      box-shadow: 3px 3px 10px map-get($map: $colors, $key: t-grey);
      padding: 0 5px;
      .title {
        padding: 20px 30px;
        text-align: center;
        font-size: 30px;
        font-weight: bold;
        color: map-get($map: $colors, $key: W_blue);
      }
      .data-box {
        height: 320px;
        display: flex;
        flex-direction: column;
        align-content: space-between;
        .data {
          width: 100%;
          height: 50%;
          .name {
            font-weight: 500;
            font-size: 25px;
            text-align: start;
            color: map-get($map: $colors, $key: t-grey);
          }
          .num {
            display: flex;
            justify-content: center;
            align-items: center;
            width: 100%;
            height: 127px;
            color: map-get($map: $colors, $key: W_blue);
            font-size: 50px;
            font-weight: bold;
          }
        }
      }
    }
  }
  .bottom {
    margin-top: 60px;
  }
}
.inform-box {
  height: 100px;
  width: 400px;
}
</style>